package com.jz.nacos.consumer;

import com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder;
import com.alibaba.nacos.spring.context.annotation.discovery.EnableNacosDiscovery;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.io.IOException;
import java.util.Properties;

@EnableDiscoveryClient
@SpringBootApplication
@EnableSwagger2
public class NacosConsumer {
//    HttpLoginProcessor httpLoginProcessor;
//    NacosPropertySourceBuilder nacosPropertySourceBuilder;
//    ClientWorker clientWorker;
//    NacosConfigPropertiesUtils nacosConfigPropertiesUtils;
    NacosPropertySourceBuilder nacosPropertySourceBuilder;
//    org.springframework.boot.actuate.endpoint.EndpointId EndpointId;

    public static void main(String[] args) {
        SpringApplication.run(NacosConsumer.class,args);
//        Properties prop = new Properties();
//        try {
//            prop.load(NacosConsumer.class.getClassLoader().getResourceAsStream("application.yml"));
//        } catch (IOException e) {
//            System.err.println("Nacos properties loading error...");
////            properties.setProperty("spring.cloud.nacos.username", "nacos");
////            properties.setProperty("spring.cloud.nacos.password", "nacos");
//        }
//
//        String nacosname = "spring.cloud.nacos.username";
//        String nacospwd = "spring.cloud.nacos.password";
////        String fileExtension = "spring.cloud.nacos.fileExtension";
//
//        Properties properties = new Properties();
//        properties.setProperty(nacosname,prop.getProperty(nacosname));
//        properties.setProperty(nacospwd,prop.getProperty(nacospwd));
////        properties.setProperty(fileExtension,prop.getProperty(fileExtension));
//
//        SpringApplication app = new SpringApplication(NacosConsumer.class);
//        app.setDefaultProperties(properties);
//        app.run(args);
    }
}
